<template>
  <ul class="articleList">
    <li v-for="(item, i) in article" :key="i">
      <router-link :to="'/articledet/'+item.id">{{ item.title }}</router-link>
    </li>
  </ul>
</template>

<script>
import { getArticle } from "../../api/Recommend";
export default {
  data() {
    return {
      article: [],
    };
  },
  mounted() {
    getArticle().then((res) => {
      this.article = res.data;
    });
  },
};
</script>

<style scoped>
.articleList li {
  padding: 0.14rem 0.18rem;
  margin-bottom: 0.02rem;
  background-color: #fff;
}
.articleList li a {
  display: inline-block;
  width: 100%;
  font-size: 0.3rem;
  font-weight: bold;
  color: #505050;
  line-height: 0.52rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
</style>
